<script lang="ts" setup name="App">
import {RouterView,RouterLink} from "vue-router";
</script>

<template>
  <div id="app">
    <div class="title">Vue路由测试</div>
<!--    导航区-->
    <div class="navigate">
      <RouterLink to="/home"  active-class="active">首页</RouterLink>
      <RouterLink to="/about" active-class="active">新闻</RouterLink>
      <RouterLink to="/news" active-class="active">关于</RouterLink>
    </div>
<!--    展示区-->
    <div class="main-content">
      <RouterView></RouterView>
    </div>
  </div>
</template>

<style scoped>
  .title{
    text-align: center;
    line-height: 100px;
    height: 100px;
    background: linear-gradient(to right, #a2a0a0, #e8e8e8);
    font-size: 30px;
    font-weight: bold;
    border-radius: 20px;
  }
  .navigate{
    margin: 20px 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    a{
      padding: 10px 20px;
      background: #a2a0a0;
      border-radius: 10px;
      text-decoration: none;
      font-size: 16px;
      color: white;
    }
    .active{
      background: #74917d;
      color: #ddb363;
    }
  }
  .main-content{
    border-radius: 20px;
    border: 1px solid black;
    height: 500px;
  }
</style>